package String2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-11-10
 * Time: 17:36
 */
public class demo3 {
    public static void main(String[] args) {
        String str1 = "acacbbbbdbabdbabdb";
        String ret = str1.replace('a','s');

        System.out.println(str1);
        System.out.println(ret);

        String ret2 = str1.replaceAll("ac","bbb");

        System.out.println(str1);
        System.out.println(ret2);

        String ret3 = str1.replaceFirst("a","c");

        System.out.println(str1);
        System.out.println(ret3);
    }
}
